------------------------------------------------------------------------------ ASG - AutoStereoGram Producer By Justin J A Smith. ------------------------------------------------------------------------------ It is a good idea to print out this document to refer to later File list: You should have the following files; - unpacked from ASG.ZIP ASG.EXE - Main program file ASG.INI - User definable variables file ASG.TXT - This file REGIFORM.ASG - ASG Registration Form. ASGMENU.ASG - Menu module (R - use command line args.) ASGPCX.ASG - PCX viewer module (R) ASGANIM.ASG - Animation module (R) ASGHELP.ASG - Online help module (R) SETTINGS.ASG - Last picture settings CUSTOM.ASG - Bitmapped custom guide spot ASG.PCX - ASG logo (untranslated) 4OCLOCK.PCX - Clock Picture (untranslated) EXAMPLE.PCX - Example output (translated and coloured) (R) = removable. If you find that you never use this module you can safely delete it. Overview: ASG is a program which attempts to translate a 640x480x16 PCX bitmap file into a black and white AutoStereoGram. You can therefore, draw a picture in Deluxe paint (for instance), and turn it into your own personal AutoStereoGram. Please bear in mind that I taught myself C a few months ago, having no previous programming experience. I wrote this program in just a few weeks. What is an AutoStereoGram? It is a picture which first appears to be a screen full of random dots, but when viewed in the correct way can turn into an amazing 3 dimensional image. It works by arranging two slightly offset images made up of random dots together, one for each eye, so that when you look beyond the resultant image, you brain fuses the two images together giving an illusion of depth. As a child (or a late developer) you may have done a similar trick, by holding you fingers together then looking beyond them. This results in a 'Phantom Finger' which seems to just float between the tips of you two fingers. I have noticed that an illusion of depth can also be achieved by staring beyond the dotty material which covers the ceiling of an old Ford Escort estate, you can probably do the same trick on lots of other things, such as small regular patterned wallpaper etc, etc... How Do I See These Pictures? Try it now. with the following diagram. Look beyond it so that the points '-|-' join up in the middle to make a third '-|-'. Continue staring at for a while, to get used to the depth, then try to reach out and touch where you think the line should be. You should find that you can never quite reach because you finger strikes the screen or paper just short of the target. oooooooooooooooooooooooo-|-ooooooooo-|-oooooooooooooooooooooooo Start up ASG.EXE and produce an AutoStereoGram using one of the examples provided. (4OCLOCK.PCX, or ASG.PCX) First time users should just press 'S', at the menu screen, to start the default PCX file translating. Ensure that you switch on the Guide Spots (squares are good to start with) as these will help you to focus the correct distance away. Position yourself just in front of the screen and look at the picture as you would look at your reflection in a mirror, until the two Guide Spots transform into three. Next, stare hard at the center spot until in becomes sharply focused. You should now be able to see the 3D image, If not then keep on looking, It can take quite a long time for your brain to be tricked. Some people can see it immediatly, but approx. 10% can see nothing. If you can't see 3D films or television with the funny glasses then you probably won't be able to see these pictures. Notes On PCX Files Produced By ASG. ASG.EXE saves the image as a version 3 PCX, this should load into most art packages, authough if you experience difficulty you can convert the file into another supported format, using an image conversion package like Graphics Workshop. You may notice that the files produced by ASG are very large - larger than an uncompressed bitmap of the same size - this is due to the very random nature of the data, and to the relative ineffeciency of the compression scheme in the PCX file format. Notes On Drawing Translatable Pictures. Try to draw everything as thickly as possible, Thin lines and small patches of colour 'get lost' in the translation, or show up as interference patterns. Don't draw any detail very close to vertical edges as these will only be seen by one eye and so a few centimetres on either side of the picture is lost. Lots of detail in the picture results in lots of interference, for instance a scanned photograph with very diffuse detail just comes out as complete chunder when translated. Save the picture that you draw as a 16 colour 640x480 res. PCX file. Note. If you plan on using Windows Paintbrush to produce pictures, be warned! The default colours are all in the wrong order, so the depths on the final picture will not be as you may have expected. Experimentation is required to ensure correct results. C Programmers - Using Custom Guide Spots. The custom guide spots 'CUSTOM' are in the file CUSTOM.ASG it contains a 12x25 pixel 16 colour _getimage() fragment. Create your own, and save them in a binary file of the same name and hey presto! custom guide spots. Only black and white colours will be saved in the final bitmap because the destination PCX file will always be monochrome, so only use colours 0, and 15. ASG.INI - The user definable variable file The settings are as follows: [settings] StartingAnim 1 Toggle Starting Animation (1=on, 0=off) EyesValue 180 Distance between images GuideSpotPositionX 320 X position of Guide Spots GuideSpotPositionY 14 Y position of Guide Spots Seed 1 Seed Random number generator (1=seed, 0=no seed) The settings must be in this order, don't put an '=' between the string and the number or the number will be ignored. You may change any of the numbers as shown above. After being switched off in ASG.INI you may delete the animation file ASGANIM.ASG otherwise the program will ask for it. The EyesValue sets the distance between the two images, a smaller value makes the images closer together so you don't have to focus as far back, If you have problems seeing an AutoStereoGram, then changing this value can often help. At 640x480, 400 is about as far as you can focus, but this value will go up to 32767, you may need to alter this value in order to translate an image that is larger than one screen (you would need to split the image up into several 640x480 screens, translate them and then stitch the resultant pictures together to make one large image) As of this version ASG does not support resolutions over 640x480 because my current monitor won't sync at anything higher. Future versions will support 800x600 and 1024x768. The GuideSpotPositionX is the distance from the left of the screen at which to place the guide spots. 320 is at the centre of the screen, 160 and 480 are a quarter and three-quarters across the screen respectivly. The GuideSpotPositionY is the distance from the top of the screen at which to place the guide spots. A value over 479 will be ignored, and guide spots will not be placed. The centre of the screen will be 240. If you set the Seed value to 0 the program will not re-seed the random number generator, and so the random patterns will be the same each time you run ASG with the same picture. This was included for animation purposes. You can often improve a dodgy looking AutoStereoGram just by re-translating it with seed switched to 1 (default value). Command Line Arguments: ASG.EXE can be run stand-alone with no menu, PCX viewer or online help, with command line arguments. These take the form: ASG.EXE [infile.PCX] [outfile.PCX] Where [infile.PCX] is the name of the PCX file that you wish to translate, and [outfile.PCX] is the destination name for the translated file (WARNING- ASG will overwrite any destination file if it already exists). NOTE: ASG.EXE executed from the command line uses the same guide spots settings as were set the last time you used the menu module. PCX Viewer ASG contains (within the PCX module ASGPCX.ASG) a PCX viewer. This correctly views any 640x480 16 colour PCX file, try it with EXAMPLE.PCX. Summary of Commands in ASG Menu Commands I or i Input File name, pressing this will clear what's there and prompt the user for a PCX file. O or o Output File name, see Input file name. V or v View PCX, prompts the user for the name of a 640x480x16 PCX file to be viewed. F1 Online help. G or g Guide Spots On/Off, toggles guide spots on/off T or t Guide Spot Style, cycles through 3 different guide spot styles SQUARE, CIRCLE & CUSTOM. Other Commands If while you are translating a PCX file into an AutoStereoGram, you press any key, the current translation will be aborted, and you will return to the menu. (DOS if you use command line args.) If you have used the menu, then after translation the program will pause to let you see the picture before saving it to disk, press any key to continue the save. or ESC to abort the save. If you used command line arguments to start ASG then after translation the program will immediatly save the picture and return to DOS. This is so that you can write a batch file to leave ASG proccesing multiple images unattended. Colouring in AutoStereoGrams (like EXAMPLE.PCX) After translation has been completed, you can colour in your AutoStereoGram. I shall explain how to do this with Deluxe Paint, but it can be done in this way with any Art package which allows you to stencil out colours, and use a gradient fill. 1. Start up Dpaint in 640x480x16 mode. (DP.EXE k) 2. Load your AutoStereoGram PCX file. 3. Stencil out the black part of the picture. 4. Create a nice flowing colour scheme using all the colours except black. (see EXAMPLE.PCX) 5. Make a gradient out of all the colours except black. 6. After selecting the gradient, right-click on the filled rectangle tool and select STRAIGHT in the linear fill section. 7. Draw a rectangle which fills the entire screen and point the arrow in the direction that you want the colour to flow in. 8. You can now fine tune your palette to suit the picture you have created, and save the final PCX file. Registration of ASG. ASG is shareware so if you think this program is useful please register. The registration fee is a minimum of œ5, please send more if you think the program is worth it. For this you will receive a registered, personalised version of the most up to date ASG, and anything else that I have finished. Please send payment in cash, cheque, or postal order. Make cheques payable to Justin J A Smith. To register print out and complete the registration form in REGIFORM.ASG or write to me with your full name and address, and also include a user name and company name for personalisation of your copy. Please send your registration fee to:- Justin J A Smith 4 Sorrel close Royston Hertfordshire SG8 9TL Please spread this program about, complete and unmutilated. Enjoy - Justin J A Smith. NOTE. I have noticed a small bug in the ASG animation. On some 386's the program will pause for several seconds before running the animation, this has something to do with my delay() function and there is nothing I can do about it. If it annoys you turn it off in ASG.INI (see above).